<?php

class YouNet_Model_User extends YouNet_Db_Table_Row
{	
	/**
	 * Get user roles
	 * @return array of roles 
	 */
	public function getRoles()
	{
		if (empty($this->id))
		{
			return array(Core_Role::ROLE_GUEST);
		}
		else
		{
			return array(Core_Role::ROLE_USER);
		}
	}
	
	/**
	 * 
	 * @return boolean
	 */
	public function isTester()
	{
		$social			= YouNet_Api::getInstance()->getSocialPlugin();
		$testers		= $social->getConfig()->get('testers');		
		if( $testers )
		{
			$arr_id_testers	= explode(',', $testers);
			if(in_array($this->id_social, $arr_id_testers) )
			{
				return true;
			}
		}
		return false;
	}
	
	public function isSupperUser()
	{
		
	}
}
